<template>
	<view class="page">
		<image class="img" v-for="(item,key) in brand_detail.detail" :key="key" :src="item" mode="widthFix"></image>
	</view>
	
</template>

<script>
	export default {
		data() {
			return {
				brand_id:0,
				brand_detail:{}
			}
		},
		onLoad(e) {
			var self = this;
			this.brand_id = e.id;
			self.$request.request({
				url:'/customized/brand_detail',
				data:{
					brand_id:self.brand_id
				},
				success:function(res){
					console.log(res)
					if(res.code==200){
						var x = res.result;
						x.detail = JSON.parse(x.detail);
						x.detail.forEach((item,index)=>{
							x.detail[index] =self.$http_img(item);
						});
						x.logo = self.$http_img(x.logo);
						self.brand_detail = x;
						// self.getCategoryList();
					}
				}
			});
		},
		onShow() {
			var self = this;
			// #ifdef H5
			let share_time_line={
				title:self.$request.h5_share_name+'.家具定制专区', // 分享标题
				link: self.$request.h5_share_url+'?page=custom', // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
				imgUrl: self.$request.h5_img_url+'/static/images/logo.png', // 分享图标
			}
			let share_app_message={
				title: self.$request.h5_share_name, // 分享标题
				desc: '领得定制产品', // 分享描述
				link: self.$request.h5_share_url+'?page=custom', // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
				imgUrl: self.$request.h5_img_url+'/static/images/logo.png', // 分享图标
			}
			uni.setStorageSync('share_time_line',share_time_line);
			uni.setStorageSync('share_app_message',share_app_message);
			self.$request.wx_config()
			// #endif
		},
		methods: {
			getCategoryList(){
				var self = this;
				self.$request.request({
					url:'/customized/category',
					data:{
						brand_id:0,
						only:1
					},
					success:function(res){
						if(res.code==200){
							var x = res.result;
							console.log(x)
							x.forEach( (item,index) =>{
								if(item.id == self.good_detail.category_id){
									self.category_name = item.title
								}
							});
						}
					}
				});
			}
		}
	}
</script>

<style>
	image{
		pointer-events: none; 
	}
	.page{
		font-size: 0;
	}
.img{
	width: 750upx;
}
.write-box{
	position: fixed;
	width: 140upx;
	height: 140upx;
	right: 20upx;
	bottom:200upx;
	z-index: 20;
	font-size: 0;
}
.write{
	width: 140upx;
	height: 140upx;
}
	
</style>
